# -*- coding:utf-8 -*-

import os
import jieba
import jieba.analyse


def load_dict():
    dict_path = os.path.split(os.path.realpath(__file__))[0]
    jieba.load_userdict(os.path.join(dict_path, "distDict.txt"))
    jieba.analyse.set_stop_words(os.path.join(dict_path, "stopDict.txt"))


if __name__ == "__main__":
    load_dict()
    text = "     我是工程           分部分项  工程量清单     装饰与安装工程"
    print(text.strip())
    tags = jieba.analyse.extract_tags(text, 20)
    print("tags : ", tags)
    print(jieba.lcut(text, cut_all=True))